import PureUserChangePasswordForm from '../components/user-change-password-form';
import * as ReactRedux from 'react-redux';
import * as UserAction from 'actions/user';

const mapStateToProps = (state) => {
  return {
    loginUser: state.loginUser
  };
};

const mapDispatchToProps = (dispatch) => {
  return {
    onSaveChangePassword: (userPassword) => {
      return dispatch(UserAction.changePassword(userPassword))
        .then(() => dispatch(UserAction.logout()));
    }
  };
};

export default ReactRedux.connect(mapStateToProps, mapDispatchToProps)(PureUserChangePasswordForm);
